<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>transform-origin</title>
    <link rel="stylesheet" href="http://coding.imweb.io/demo/reset.css">
    <style type="text/css">
        body {
            background: #fff;
        }
        .desc {
            text-align: center;
            line-height: 50px;
        }
        .box-wrap {
            border: 1px dashed #999;
            background-color: #f5f5f5;
            width: 300px;
            line-height: 50px;
            height: 50px;
            color: #fff;
            margin: 100px auto;
            position: relative;
        }
        .box {
            position: absolute;
            width: 100%;
            height: 100%;
            background-color: rgba(128, 0, 128, .7);
            text-align: center;
            transition: transform 1s;
        }
        .wrap--rotate:hover .box {
            transform: rotate(15deg);
        }
        .box-origin-top-left {
            transform-origin: left top;
        }
        .box-origin-right {
            transform-origin: right; /* 设置一个值，则另一个为50% */
        }
        .box-origin-px {
            transform-origin: 200px 80%;
        }
    </style>
</head>
<body>
    <p class="desc">rotate(15deg)，请把鼠标放到对应的盒子上，看下效果</p>
    
    <div class="box-wrap wrap--rotate">
        <div class="box">默认 transform-origin</div>
    </div>
    <div class="box-wrap wrap--rotate">
        <div class="box box-origin-top-left">transform-origin: left top;</div>
    </div>
    <div class="box-wrap wrap--rotate">
        <div class="box box-origin-right">transform-origin: right;</div>
    </div>
    <div class="box-wrap wrap--rotate">
        <div class="box box-origin-px">transform-origin: 200px 80%;</div>
    </div>
</body>
</html>
